package cn.ex.ymcc.feign.fallback;

import cn.ex.ymcc.feign.MediaFeignClient;
import cn.ex.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MediaFeignClientFactory implements FallbackFactory<MediaFeignClient> {
    @Override
    public MediaFeignClient create(Throwable throwable) {
        return new MediaFeignClient(){


            @Override
            public JSONResult selectByChapterId(Long id) {
                return JSONResult.error("服务不可达");
            }
        };
    }
}
